<template>
    <div>
        <el-form ref="form" :model="current" label-width="126px">
            <el-form-item label="基金代码">
                <el-input v-model="current.code"></el-input>
            </el-form-item>
            <el-form-item label="基金名称">
                <el-input v-model="current.name"></el-input>
            </el-form-item>
            <el-form-item label="基金类型">
                <el-select v-model="current.type" placeholder="请选择活动区域">
                    <el-option label="货币型" value="货币型"></el-option>
                    <el-option label="稳健型" value="稳健型"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="周单位净值涨幅">
                <el-input v-model="current.lastMonthGrowth"></el-input>
            </el-form-item>
            <el-form-item label="起购额度">
                <el-input v-model="current.buyMin"></el-input>
            </el-form-item>
            <el-form-item label="当前买入费率">
                <el-input v-model="current.buySourceRate"></el-input>
            </el-form-item>
            <el-form-item label="基金经理">
                <el-input v-model="current.manager"></el-input>
            </el-form-item>
            <el-form-item label="基金规模">
                <el-input v-model="current.fundScale"></el-input>
            </el-form-item>
            <el-form-item label="当前七日年化收益">
                <el-input v-model="current.sevenDaysYearIncome"></el-input>
            </el-form-item>
            <el-form-item label="禁用账户">
                <el-switch
                    v-model="current.status"
                    active-value="1"
                    inactive-value="2"
                    active-color="#13ce66"
                    inactive-color="#ff4949"
                    active-text="上架"
                    inactive-text="下架"
                >
                </el-switch>
            </el-form-item>
        </el-form>
        <!-- 操作按钮 -->
        <div slot="footer" class="dialog-footer">
            <el-button>取 消</el-button>
            <el-button type="primary" @click="addCurrent">确 定</el-button>
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            current: {
                payType: "活期",
                code: "001800",
                name: "张煌源电竞投资活期基金",
                type: "货币型",
                buyMin: 100,
                buySourceRate: 0,
                manager: "张煌源",
                fundScale: "813.69亿",
                sevenDaysYearIncome: 1.949,
                status: "1",
            }
        }
    },
    methods:{
        async addCurrent(){
            const formData = new FormData();
            formData.code = this.current.code;
            formData.name = this.current.name;
            const res = await this.$http.current.addCurrentData(formData);
            console.log(res);
        }
    }
};
</script>

<style lang="scss" scoped>
.dialog-footer {
    text-align: right;
}
</style>